<?php

namespace App\Providers;

use Illuminate\Support\Facades\Event;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        'App\Events\ActivityPaused' => [
            'App\Listeners\FlushRedisStorage',
        ],
        'App\Events\ActivityStarted' => [
            'App\Listeners\RefreshRedis',
        ],
        'App\Events\EnrollAudited' => [
            'App\Listeners\Vote\CandidateAuditedListener',
        ],
        'App\Events\VoteCandidateDeleted' => [
            'App\Listeners\Vote\CandidateDeletedListener',
        ],
        'App\Events\ActivityCommonCreated' => [
            'App\Listeners\ActivityCommon\WriteActivityToRedis',
        ],
        'App\Events\ActivityCommonUpdated' => [
            'App\Listeners\ActivityCommon\RewriteActivityToRedis',
        ],
        'App\Events\ShakingCreated' => [
            'App\Listeners\Shaking\WriteShakingToRedis',
        ],
        'App\Events\ShakingUpdated' => [
            'App\Listeners\Shaking\RewriteShakingToRedis',
        ],
        'App\Events\RouletteCreated' => [
            'App\Listeners\Roulette\WriteRouletteToRedis',
        ],
        'App\Events\RouletteUpdated' => [
            'App\Listeners\Roulette\RewriteRouletteToRedis',
        ],
        'App\Events\ScratchCreated' => [
            'App\Listeners\Scratch\WriteScratchToRedis',
        ],
        'App\Events\ScratchUpdated' => [
            'App\Listeners\Scratch\RewriteScratchToRedis',
        ],
        'App\Events\GoldenEggsCreated' => [
            'App\Listeners\GoldenEggs\WriteGoldenEggsToRedis',
        ],
        'App\Events\GoldenEggsUpdated' => [
            'App\Listeners\GoldenEggs\RewriteGoldenEggsToRedis',
        ],
        'App\Events\PrizeBinded' => [
            'App\Listeners\Prize\WritePrizesToRedis',
        ],
        'App\Events\EntityPrizeCreated' => [
            // 生成实物奖品兑换码
            'App\Listeners\Prize\GeneratePrizeCode',
        ],
        'App\Events\VoucherCodeImported' => [
            'App\Listeners\Prize\WriteVoucherCodeToRedis',
        ],
        'App\Events\TakebookCreated' => [
            'App\Listeners\Takebook\WriteTakebookToRedis',
        ],
        'App\Events\TakebookUpdated' => [
            'App\Listeners\Takebook\RewriteTakebookToRedis',
        ],
        'App\Events\GuessCodeCreated' => [
            'App\Listeners\GuessCode\WriteGuessCodeToRedis',
        ],
        'App\Events\GuessCodeUpdated' => [
            'App\Listeners\GuessCode\RewriteGuessCodeToRedis',
        ]
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();
        //
    }
}
